<template>
  <div class="app-main-container">
    <el-tabs v-model="activeTab">
      <el-tab-pane :label="$t('message.offgl')" name="0"><OfflinecoursesList v-if="activeTab === '0'" :meta="meta" @changeTabs="changeTabs" /></el-tab-pane>
      <el-tab-pane v-if="meta.indexOf('Schedule') > -1" :label="$t('message.kbgl')" name="1"><Schedule v-if="activeTab === '1'" :meta="meta" @changeTabs="changeTabs" /></el-tab-pane>
      <el-tab-pane v-if="meta.indexOf('MakeUpLessons') > -1" :label="$t('message.qkbkjl')" name="2"><MakeUpLessons v-if="activeTab === '2'" :meta="meta" /></el-tab-pane>
      <el-tab-pane :label="$t('message.hkjl')" name="3"><ChangeRecord v-if="activeTab === '3'" :meta="meta" /></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import OfflinecoursesList from './tabs/offlinecoursesList'
import Schedule from './tabs/schedule'
import MakeUpLessons from './tabs/makeUpLessons'
import ChangeRecord from './tabs/changeRecord'
export default {
  name: 'ConventionCourse',
  components: {
    OfflinecoursesList,
    Schedule,
    MakeUpLessons,
    ChangeRecord
  },
  data() {
    return {
      activeTab: '0',
      meta: []
    }
  },
  created() {
    this.meta = this.$route.meta.buttons || []
    if (this.$route.query.activeTab) {
      this.activeTab = this.$route.query.activeTab
    }
  },
  activated() {
    if (this.$route.query.activeTab) {
      this.$refs.taskAdminRef.handleQuery()
    }
    if (this.$route.query.activeTab) {
      this.activeTab = this.$route.query.activeTab
    }
  },
  methods: {
    changeTabs(val) {
      // this.activeTab = val
    }
  }

}
</script>

<style lang="scss" scoped>

</style>
